package com.ra.landlord;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.ra.system.Version;

/**
 * 支出记录
 * 
 * @author Jerry
 *
 */
@Entity
@Table(name = "ra_payrecord")
public class PayRecord implements Version, LandlordOwner {

	private Integer id;
	
	// TODO: pro
	private Integer product;
	
	// 费用内容
	private String content;
	
	// 
	private BigDecimal price;
	
	private Date creationOn;
	
	// 是否预设， 暂未用
	private Boolean preset;
	
	// see WorkLog.type
	private Integer type;
	
	// see WorkLog.exType
	private Integer exType;
	
	// see WorkLog.handleType
	private Integer handleType;
	
	// 按月，按日
	private Integer timeType;
	
	// 用于预设的间隔时间， 暂未用
	private Integer intervalDay;
	
	// 用于预设的间隔时间， 暂未用
	private Integer intervalTime;
	
	// see WorkLog.remind
	private Integer remind;
	
	// see WorkLog.remindTime
	private Date remindTime;
	
	// TODO: administrator_id

	private LandlordOwnerUser landlordUser;
	
	private Integer version;
	
	private Integer status;
	
	@Id
	@GeneratedValue
	@Column(name = "notebook_id")
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "notebook_pro")
	public Integer getProduct() {
		return product;
	}

	public void setProduct(Integer product) {
		this.product = product;
	}

	@Column(name = "notebook_content")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "notebook_price")
	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	@Column(name = "notebook_time")
	public Date getCreationOn() {
		return creationOn;
	}

	public void setCreationOn(Date creationOn) {
		this.creationOn = creationOn;
	}

	@Column(name = "notebook_type_preset")
	public Boolean getPreset() {
		return preset;
	}

	public void setPreset(Boolean preset) {
		this.preset = preset;
	}

	@Column(name = "notebook_type")
	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "notebook_type_ex")
	public Integer getExType() {
		return exType;
	}

	public void setExType(Integer exType) {
		this.exType = exType;
	}

	@Column(name = "notebook_Type_Handle")
	public Integer getHandleType() {
		return handleType;
	}

	public void setHandleType(Integer handleType) {
		this.handleType = handleType;
	}

	@Column(name = "notebook_time_type")
	public Integer getTimeType() {
		return timeType;
	}

	public void setTimeType(Integer timeType) {
		this.timeType = timeType;
	}

	@Column(name = "notebook_interval_day")
	public Integer getIntervalDay() {
		return intervalDay;
	}

	public void setIntervalDay(Integer intervalDay) {
		this.intervalDay = intervalDay;
	}

	@Column(name = "notebook_interval_time")
	public Integer getIntervalTime() {
		return intervalTime;
	}

	public void setIntervalTime(Integer intervalTime) {
		this.intervalTime = intervalTime;
	}

	@Column(name = "notebook_IsRemind")
	public Integer getRemind() {
		return remind;
	}

	public void setRemind(Integer remind) {
		this.remind = remind;
	}

	@Column(name = "notebook_RemindTime")
	public Date getRemindTime() {
		return remindTime;
	}

	public void setRemindTime(Date remindTime) {
		this.remindTime = remindTime;
	}
	

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "createuserid")
	public LandlordOwnerUser getLandlordUser() {
		return landlordUser;
	}

	public void setLandlordUser(LandlordOwnerUser landlordUser) {
		this.landlordUser = landlordUser;
	}
	

	@Column(name = "version_id")
	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	@Column(name = "data_status")
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
}
